<?php
class Block_BlkCart extends Zend_View_Helper_Abstract{

	public function blkCart (){
		//echo '<br>' . __METHOD__;
		
		$view  = $this->view;
		$yourCart = new Zend_Session_Namespace('cart');
		$tmp = $yourCart->cart;
		/*echo '<pre>';
		print_r($tmp);
		echo '</pre>';*/
		$countItem = 0;
		if(count($tmp)>0){
			foreach($tmp as $key => $val){
				$countItem += $val;
			}
		}
		//echo $countItem;
		$linkCart = $view->baseUrl('/shopping/index/view-cart');
		if($countItem >0){
			$showItem = '<a href="' . $linkCart . '">'. $countItem . ' sản phẩm';
		}else{
			$showItem = '0 sản phẩm';
		}
		
		require_once (BLOCK_PATH . '/BlkCart/default.php');
	}
}